home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Jul 89 / W0074-Re[2] GC Hacks-Jul89 < prev    next >
Encoding:
Text File  |  1989-07-18  |  1.1 KB  |  29 lines  |  [TEXT/GEOL]

  1. Item    5023232                         14-July-89        16:41
  2.  
  3. From:   BURBECK.S                       Burbeck, Steve
  4.  
  5. To:     KORNHER                         Scarab Research, C Kornher, PRT
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    Re: Re GC Hacks
  10.  
  11. Chris,
  12.  
  13. If the object contains no references to other objects, deep and shallow cloning
  14. are the same.  Otherwise, the semantics of deep versus shallow cloning are
  15. different.  Shallow cloning proliferates references to objects (which is easy
  16. to handle with automatic GC and difficult with manual GC), whereas deep cloning
  17. proliferates objects.  So, on the face of it, deep cloning would seem to be
  18. more compatible with manual GC.  Despite that, I don't know of a case where
  19. automatic deep cloning is the default.  In Smalltalk and MacApp and C++, the
  20. default is shallowClone.  Presumably most MacApp programmers only use shallow
  21. clone when objects contain no other object references.
  22.  
  23. As you imply, only the programmer can know, on a case by case basis, whether
  24. she wants recursive cloning or only a clone of the top level (or sometimes
  25. something in between).
  26.  
  27. Steve burbeck
  28.  
  29.